<style type="text/css">
    .tableContent th, .tableContent td{text-align:center;}
</style>

<div class="bjui-pageHeader">
	<div style="padding:10px 0 2px 0;">
		<form id="pagerForm" action="<?=admin_url('admin');?>" method="post" data-toggle="ajaxsearch">
			<input type="hidden" name="pageSize" value="<?=$pageSize;?>">
			<input type="hidden" name="pageCurrent" value="<?=$pageCurrent;?>">
			<input type="hidden" name="orderField" value="<?=$orderField;?>">
			<input type="hidden" name="orderDirection" value="<?=$orderDirection;?>">
			<div class="bjui-searchBar">
				<label style="vertical-align:middle;">选择:</label>&nbsp;
				<select name="keytype" data-toggle="selectpicker">
					<option value="_username_like" <?php if($keytype=='_username_like'):?>selected<?php endif;?>>用户名</option>
					<option value="nickname" <?php if($keytype=='nickname'):?>selected<?php endif;?>>昵称</option>
					<option value="id" <?php if($keytype=='id'):?>selected<?php endif;?>>用户ID</option>
					<option value="role_id" <?php if($keytype=='role_id'):?>selected<?php endif;?>>角色ID</option>
				</select>&nbsp;
				<input type="text" value="<?=$keyword;?>" name="keyword" class="form-control" size="16">&nbsp;

				<label style="vertical-align:middle;">状态:</label>&nbsp;
				<select name="status" data-toggle="selectpicker">
					<option value="all">全部</option>
					<option value="1" <?php if($status == '1'):?>selected<?php endif;?>>正常</option>
					<option value="2" <?php if($status == '2'):?>selected<?php endif;?> style="color:red;">禁止</option>
				</select>&nbsp;

				<button type="submit" class="btn-blue" data-icon="search" style="margin-left:30px;">查询</button>&nbsp;&nbsp;
				<a class="btn btn-green" href="javascript:;" data-toggle="reloadsearch" data-icon="refresh">刷新</a>

				<div class="pull-right">
					<button type="button" class="btn-blue" data-url="<?=admin_url('admin/add');?>" data-id="admin-add" data-icon="plus" data-toggle="dialog" data-width="600" data-height="400" data-mask="true" style="margin-right:14px;">添加</button>
				</div>
			</div>
		</form>
	</div>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false" data-toggle="tablefixed">
        <thead>
            <tr>
                <th data-order-field="id" data-order-direction="desc">ID</th>
                <th data-order-field="username">用户名</th>
                <th data-order-field="status">状态</th>
                <th>角色</th>
                <th data-order-field="logins">登录次数</th>
                <th>昵称</th>
                <th>手机号</th>
                <th>邮箱</th>
                <th data-order-field="create_time">创建日期</th>
                <th>最后登录IP</th>
                <th data-order-field="last_time">最后登录时间</th>
                <th width="100">操作</th>
            </tr>
        </thead>
        <tbody>
			<?php foreach ($list as $v):?>
			<tr data-id="<?=$v->id;?>">
				<td><?=$v->id;?></td>
				<td><?=$v->username;?></td>
				<td <?=Iif($v->status=='2', 'class="red"');?>><?=$status_arr[$v->status];?></td>
				<td><?=$admin_roles[$v->role_id];?></td>
				<td><?=$v->logins;?></td>
				<td><?=$v->nickname;?></td>
				<td><?=$v->mobile;?></td>
				<td><?=$v->email;?></td>
				<td><?=date("Y-m-d", $v->create_time);?></td>
				<td><?=$v->last_ip;?></td>
				<td><?=date("Y-m-d H:i:s", $v->last_time);?></td>
				<td>
					<a href="<?=admin_url('admin/edit/' . $v->id);?>" class="btn btn-green" data-toggle="dialog" data-id="admin-edit" data-width="600" data-height="400" data-mask="true">编辑</a>
					<!-- 不允删除: 超级管理员 或 自己 -->
					<?php if($v->id != '1' AND $v->id != $this->admin->id):?>
						<a href="<?=admin_url('admin/delete/' . $v->id);?>" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删</a>
					<?php endif;?>
				</td>
			</tr>
			<?php endforeach;?>
        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="10" <?php if($pageSize==10):?>selected<?php endif;?>>10</option>
                <option value="20" <?php if($pageSize==20):?>selected<?php endif;?>>20</option>
                <option value="40" <?php if($pageSize==40):?>selected<?php endif;?>>40</option>
                <option value="80" <?php if($pageSize==80):?>selected<?php endif;?>>80</option>
                <option value="160" <?php if($pageSize==160):?>selected<?php endif;?>>160</option>
            </select>
        </div>
        <span>&nbsp;条，共 <?=$totalCount;?> 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="<?=$totalCount;?>" data-page-size="<?=$pageSize;?>" data-page-current="<?=$pageCurrent;?>">
    </div>
</div>